﻿#ifndef CPROGRESSDLG_H
#define CPROGRESSDLG_H

#include <QDialog>
#include<QTime>
#include<QString>

class QLabel;
class QProgressBar;
class QPushButton;
class QGridLayout;
class QHBoxLayout;

QT_BEGIN_NAMESPACE
namespace Ui { class CProgressDlg; }
QT_END_NAMESPACE

class CProgressDlg : public QDialog
{
    Q_OBJECT

public:
    CProgressDlg(const QStringList task,QWidget *parent=nullptr);
    ~CProgressDlg();

public:

void BeginLayout();
void AfterLayout();

public:

 QTime m_BaseTime;//声明一个基准时间

private:

    QStringList m_sTask;//声明一个字符串列表Task，用于接收传过来的（字符串）数据
    QString m_sShowStr;//存放计时数据

private:

    QVector<QLabel*> mLabels;

    QLabel *pM_edit1;
    QLabel *pM_edit2;
    QLabel *pM_edit3;
    QLabel *pM_data1;
    QLabel *pM_data2;
    QLabel *pM_data3;
    QLabel *pM_data4;
    QProgressBar *pM_progressBar;
    QPushButton *pM_cancelbtn;
    QGridLayout *pM_mainLayout;
    QHBoxLayout *pM_HmainLayout;

public slots:

    void ProgressBar(int step,int max,int curr);
    void ProgressTask(int step,int max,int curr);
    void SetData1(int step,int max,int curr);
    void SetData2();
    void SetData3(QString P_str);
    void SetData4(QString A_str);
    void SetCancelBtn();
private:
    Ui::CProgressDlg *ui;
};
#endif // CPROGRESSDLG_H
